# Maintainer: Andreas Radke <andyrtr@archlinux.org>
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Alexander Fehr <pizzapunk gmail com>

pkgname=desktop-file-utils
pkgver=0.27
pkgrel=1
pkgdesc="Command line utilities for working with desktop entries"
url="https://www.freedesktop.org/wiki/Software/desktop-file-utils"
arch=(loong64 x86_64)
license=(GPL)
depends=(glib2)
makedepends=(
  git
  meson
)
_commit=2470d73f93d02b354ecbee7c2f02a83efaae84d8  # tags/0.27
source=(
  "git+https://gitlab.freedesktop.org/xdg/desktop-file-utils.git#commit=$_commit"
  update-desktop-database.hook
)
b2sums=('SKIP'
        '2420bfc3deea04a7a00da36043408fb6c6a89d626a52dd47fef165c6aedf0c9c332b87ee3c497e1093f6e4972284614eb6e5e59c1a9d3229acfd755a6285037a')
validpgpkeys=(
  C01EDE5BB0D91E26D003662EC76BB9FEEAD12EA7 # Hans Petter Jansson <hpj@cl.no>
)

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  depends+=(libglib-2.0.so)

  meson install -C build --destdir "$pkgdir"
  install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 *.hook
}

# vim:set sw=2 sts=-1 et:
